package com.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.usian.model.record.Recordd;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

@Mapper
public interface RecordMapper extends BaseMapper<Recordd> {

    @Select("select * from recordd where uid=#{id}")
    List<Recordd> findUserScore(Integer id);

    @Insert("INSERT INTO recordd (name, score, datee, uid) VALUES (#{name}, #{score}, #{datee}, #{uid})")
    int addRecord(
            @Param("name") String name,
            @Param("score") Integer score,
            @Param("datee") Date datee,
            @Param("uid") Integer uid
    );
}
